home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Creative Computers
/
Creative Computers CD-ROM, Volume 1 (Legendary Design Technologies, Inc.)(1994).iso
/
commercial
/
inovatronics
/
candodemo
/
testdrivemanual
/
testdrive2.doc
< prev
next >
Wrap
Text File
|
1994-11-17
|
17KB
|
414 lines
**** CANDO TEST DRIVE #2
Now that you've completed the first Test Drive, you have learned
to create objects, such as Buttons and Fields, and to tell them to do
something. Now it's time to put this basic knowledge to work by
making a real application.
You are going to make a movie database. To assist in making
database applications, CanDo comes with a Deck called "DBBaseDeck".
It contains "Routines" which are useful for making many kinds of
databases. While these routines are not very complicated, in this
tutorial we won't go into detail on how they work. However, you don't
need to know much about them to make use of them. You can use them
like the Editor Tools in the first Text Drive.
So let's get started by loading "DBBaseDeck". You are going to be
using a Menu option to load the Deck. Therefore, click on some part
of the Main Panel which does not have a Button. Now, using the right
mouse button, select "Open..." from the Deck Menu.
This will bring up the File Requester. Click on DBBaseDeck in the
File List and then select Ok.
This will open a plain looking window. This deck only contains a
single card which does not have any Objects.
The Process for making this application is:
· Define the picture window.
· Make a couple of buttons for moving around in the database.
(i.e. Next Entry, Previous Entry, Add Entry)
· Make a couple of "database" Objects.
· Test it out a little.
· Add the remaining operations
(Search, Delete, Sort, Load and Save)
First, let's make your window little more jazzy. Select the
Window Icon from the Main Panel.
See Picture "Images/WindowIcon"
Click on the Dimension Button and then the "Unnamed" Picture
Button. Now select "MovieBackdrop.Pic" and click Ok on the File
Requester, Dimension Requester and finally the Window Editor.
This will bring up a window similar to the one used in the first
Test Drive but with some nice titles and imagery. Now to add the
buttons which allow you to move through the database entries.
The first button will cause the database to move to the the
previous entry. It will use the same yellow arrow used in the first
Test Drive. Click on Add and then the Button Icon on the Main Panel.
See Picture "Images/AddIcon"
See Picture "Images/ButtonIcon"
Position the cross-hairs to the left of the brown box at the
coordinates 15,50 , click and release the left mouse button.
The button you are creating will cause the database to move
backwards to the previous entry. In this application you are going to
give names to the Objects you create. Change "Button#1" to "Previous
Button".
See Picture "Images/Name.PreviousButton"
Click on the box next to "Image" and then the "Unnamed" Image Name
Button. Select "left1.br" by double-clicking it in the File List
(Some people find this easier than selecting the file and clicking
Ok). Click Ok on the Image Button Requester to return to the Button
Editor. Click on the "COMPLEMENT" Highlight Button and then the
"Undefined" button to select the alternate image for this button.
Select "left2.br" and return to the Highlight Style Requester. Click
Ok to return to the Button Editor.
Click on the Release Button to bring up the Script Editor. The
DBBaseDeck contains the Routines necessary for creating this, and many
other database applications. To access them, select "Routines..."
from the "Special" Menu.
This will bring up the Routine Browser.
See Picture "Images/RoutineBrowser"
From the list of Routine names, select "Previous Entry" by
clicking on it once. Then, click the "Insert a 'Do' to this Routine"
Button. This will create the following line.
Do "Previous Entry"
Click Ok to return to the Button Editor, and then Ok again to
return to the Main Panel.
Now you are going to do a similar process for creating the button
which will cause the database to move the next entry. Click on the
Add and Button Icons on the Main Panel. Position the cross-hairs at
60,50 and click and release the mouse button. When the Button Editor
appears, change "Button#1" to "Next Button". Click on the box next to
Image, and then the "Unnamed" buttons. Select "right1.br" and return
to the Button Editor. Change the Highlight from "COMPLEMENT" to
"right2.br". Next, click on the Release button to go to the Script
Editor. Select "Routines..." from the Special Menu. This time click
on "Next Entry" and then "Insert a 'Do' to this Routine".
Do "Next Entry"
Exit the Script Editor and then the Button Editor by clicking
their Ok buttons.
Next you will add a Text button below the two arrows which will
"Add" new entries to the database. Click on Add and then the Button
Icons. Position the cross-hairs at 20,75, click and release the mouse
button (text buttons get their size from the text).
Change "Button#1" to "Add Button". Click on the box next to Text
to bring up the Font/Text Requester. Change "Add Button" to " Add ".
Make sure there are two space on both sides of "Add". Because the
Text buttons conform to the size of the Text, the spaces will make the
button longer.
See Picture "Images/Text.Add"
Click on Yellow in the Color Palette and then the Shadowed button.
Click Ok to return to the Button Editor
Click on the "OUTLINE" Border Button. Click on the Shadow style
and Ok to return to the Button Editor.
Click on the Release Button to go to the Script Editor. Using the
Routine Browser, insert a 'Do' to the "Add Entry" routine.
Do "Add Entry"
Exit the Script Editor and then the Button Editor.
You've created the essential operations to add and look at
database entries. Now you need to make some "database" fields to use.
In this application you are going to add a "Name" text field, a
"Tape#" integer (number) field, and a "Description" document. (These
will be easy!)
Click on the Add and Field Icons on the Main Panel.
See Picture "Images/AddIcon"
See Picture "Images/FieldIcon"
Position the cross-hairs at 230,52. Press and hold the left mouse
button. Drag the mouse to the right until the width is 320 and
release the mouse button.
To make this a database field, set the Name Field to ".Name".
See Picture "Images/Name.Name"
When you want a Field, Document, or Button to be included in the
database, the name must begin with ".", followed by a letter, and then
as many letters or numeric characters (0 - 9) as you want. (The name
cannot contain spaces.) That's all you do to designate a database
object.
Click on the OUTLINE Border button and change it to the new Double
Border style and click Ok.
This Field has a Width of 320. This leaves room for 40 characters
(320 ÷ 8 pixels per character). Click on the box, containing a
checkmark, next to the title Text.
See Picture "Images/TextCheckmark"
This brings up the Text Requester. Change the "Max Number of
Characters" to 40.
See Picture "Images/MaxChars"
Click Ok on the Text Requester. Click Ok on the Field Editor
Requester to return to the Main Panel.
Click on the Add and Field Icons. Position the cross-hairs at
230,70. Press-Drag the mouse to the right until the Width is 80 and
release the mouse button. When the Field Editor appears, change the
Name to ".Number".
See Picture "Images/Name.Number"
Click on the Box next to Integer.
See Picture "Images/IntegerBox"
This changes the Field into an Integer Field. This restricts the
field to only containing numeric values. This requester allows you to
specify limits for these values and the initial value. Change Minimum
to 0.
See Picture "Images/MinimumVal"
Click Ok to return to the Field Editor. Change the Border to the
new Double Border Style. Click Ok on the Field Editor to return to
the Main Panel.
Finally, let's add the Description Document. Click on the Add and
the Document Icons on the Main Panel.
See Picture "Images/AddIcon"
See Picture "Images/DocumentIcon"
Position the cross-hairs at 230,88. Press-Drag the mouse to make
the dimensions 320,64 and then release the mouse pointer.
Set the Name to ".Description" and the Document to "Description - Doc"
See Picture "Images/Name.Description"
The first Test Drive used the Document Field to spec